import React from 'react';
import ReactDOM from 'react-dom';
import classnames from 'classnames';
//removeIf(!production)
import './index.less';
//endRemoveIf(!production)
type ILoading = {
  open: boolean;
  fullScreen?: boolean;
  className?: string;
};

const Loading = ({
  open = false,
  fullScreen = false,
  className = '',
}: ILoading): JSX.Element => {
  if (!open) {
    return <></>;
  }
  const dom=<div
    className={classnames(
      'elelive-loading',
      fullScreen ? 'elelive-loading-fullScreen' : '',
      className,
    )}
  >
    <img
      className="elelive-loading-image"
      src=""
      alt=""
    />
  </div>

  if(fullScreen){
    return ReactDOM.createPortal(dom, document.body);
  }
  return dom;


};
export default Loading;
